package com.sduept.nwld.dataserver.enums;

/**
 * 
 * @author Author
 *
 */
public enum OverhaulRegexTypeEnum {
	/**
	 * 此类为正则表达式匹配 注 :在数据库存储时， [\\s\\S] -> \s\S
	 */
	LINE_REGEX("1", "检修设备线路判断"), 
	POWER_REGEX("2", "检修设备变压器判断"), 
	BREAKER_REGEX("3", "检修设备开关判断"),
	BUS_REGEX("4", "检修设备母线判断"),
	LINE_DATA_REGEX("5", "检修设备线路数据提取"), 
	POWER_DATA_REGEX("6", "检修设备变压器数据提取"), 
	BREAKER_DATA_REGEX("7", "检修设备开关数据提取"),
	BUS_DATA_REGEX("8", "检修设备母线数据提取"),
	VOL_REGEX("9", "电压等级判断");

	private String desc;
	private String code;

	private OverhaulRegexTypeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public String getDesc() {
		return desc;
	}

	public String getCode() {
		return code;
	}

	public static OverhaulRegexTypeEnum val(String desc) {
		for (OverhaulRegexTypeEnum s : values()) {
			if (desc.equals(s.getDesc()))
				return s;
		}
		return null;
	}

	public static OverhaulRegexTypeEnum valBycode(String code) {
		for (OverhaulRegexTypeEnum s : values()) {
			if (code.equals(s.getCode()))
				return s;
		}
		return null;
	}
}
